Skip to content

docs: fix README structure of stats/base/dists/chi/cdf#11740

Merged
kgryte merged 2 commits intodevelopfrom
philipp/drift-stats-base-dists-chi-2026-04-23
Apr 23, 2026
Merged

docs: fix README structure of stats/base/dists/chi/cdf#11740
kgryte merged 2 commits intodevelopfrom
philipp/drift-stats-base-dists-chi-2026-04-23

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • Aligns outliers in @stdlib/stats/base/dists/chi with namespace majority patterns (random namespace pick, seed 20260423).

Namespace summary

  • Namespace: @stdlib/stats/base/dists/chi
  • Members analyzed: 12 (cdf, ctor, entropy, kurtosis, logpdf, mean, mode, pdf, quantile, skewness, stdev, variance)
  • Features analyzed: file tree, package.json top-level + scripts + stdlib keys, manifest.json keys, README section order & heading levels, test/benchmark/examples filenames, public signature, validation prologue, error construction, JSDoc shape, @stdlib/* dependency set.
  • Features with clear majority (≥75% conformance) and a confirmed outlier: 1 (README section structure for native-addon packages, 9/10 = 90% conformance; outlier = cdf).
  • Features with partial majorities that failed validation as drift: JSDoc paramTags/returnsType for k split between NonNegativeNumber and PositiveNumber — reflects real implementation boundary behavior at k=0; native-addon file set and gypfile key missing from ctor and quantile — intentional (class constructor and no closed-form inverse CDF; chisquare/quantile and gamma/quantile similarly lack native code).
  • Features with no majority and excluded from drift detection: returnKind was 12/12 value (trivially unanimous); errorConstruction majority was meaningless because 11/12 math functions construct no error strings at all (only ctor throws, and it already uses format).

Per-outlier corrections

stats/base/dists/chi/cdf

Fixes structural drift in the cdf README where ### C APIs was nested inside <section class="usage"> at the wrong heading level, and the JS ## Examples block appeared after the C content rather than before it. Closed the JS usage section after cdf.factory, inserted ## Examples before the * * * rule, wrapped the C block in a top-level <section class="c">, and promoted the inner #### Usage to ### Usage. 9 of 10 sibling packages in @stdlib/stats/base/dists/chi (entropy, kurtosis, logpdf, mean, mode, pdf, skewness, stdev, variance) already follow this structure, confirming the corrected layout matches the enforced canonical form required by remark-lint-expected-html-sections.

Related Issues

Does this pull request have any related issues?

No.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Validation

  • Structural feature extraction run across all 12 members (file tree, package.json keys, README headings, manifest.json, test/benchmark/examples filenames).
  • Semantic feature extraction via per-package sonnet agents (public signature, validation prologue, error construction, JSDoc shape, @stdlib/* dependencies).
  • Three-agent drift validation: opus semantic-review, opus cross-reference, sonnet structural-review. All three converged on cdf README restructure as the single high-signal correction; no intentional deviation, no cascading changes, no test/example/contract impact.

Deliberately excluded:

  • ctor and quantile lacking native-addon files (manifest.json, binding.gyp, src/, lib/native.js, benchmark.native.js, test.native.js, gypfile) — intentional. ctor is a constructor class; quantile has no closed-form inverse for the chi CDF. Peer distributions (chisquare/quantile, gamma/quantile) match.
  • stdev/test/fixtures/python/ vs. */test/fixtures/julia/ elsewhere — diverging test-fixture generator would require regenerating data.json and is out of scope for mechanical drift correction.
  • JSDoc k typed as NonNegativeNumber in 7 packages vs. PositiveNumber in 5 — each typing matches the package's actual domain (explicit handling at k=0 vs. NaN return at k<=0).
  • JSDoc returnsType splintered across Probability/Chi/number/NonNegativeNumber/PositiveNumber — each reflects the true output range of that moment / function.

Local report: ~/drift-reports/drift-stats-base-dists-chi-2026-04-23.md.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This PR was produced by Claude Code running the cross-package drift-detection routine: random namespace pick (seed 20260423stats/base/dists/chi), structural + semantic feature extraction across all 12 members, majority vote at the 75% threshold, and three-agent validation (semantic review, cross-reference, structural review) before any edit. Only corrections that all three agents confirmed as mechanical, non-behavior-changing, and backed by a ≥75% conformance majority were applied. A human will audit and promote from draft.



Generated by Claude Code

…ions

Restructured the README so the C APIs block is a top-level section after the JavaScript Examples, matching the pattern followed by 9/10 native-addon siblings in `stats/base/dists/chi`. Closes the outer `<section class="usage">` after the `cdf.factory` subsection, adds the JavaScript `## Examples` section, then wraps the C APIs in `<section class="c">` with `## C APIs` (previously `### C APIs`, nested inside the JS usage section) and promotes the C `### Usage` heading from `#### Usage` to match the majority conformance (90% of sibling native-addon packages).

Docs-only change; no source, tests, examples, or public API affected.

https://claude.ai/code/session_01FXfscMHk9EUo3WE1FJswD5
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label Apr 23, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

stdlib-bot commented Apr 23, 2026

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/chi/cdf $\color{red}277/279$
$\color{green}+0.00%$
$\color{red}23/24$
$\color{green}+0.00%$
$\color{green}4/4$
$\color{green}+0.00%$
$\color{red}277/279$
$\color{green}+0.00%$

The above coverage report was generated for the changes in this PR.

@Planeshifter Planeshifter changed the title style: align outliers in stats/base/dists/chi with namespace majority patterns docs: fix README structure of stats/base/dists/chi/cdf Apr 23, 2026
@Planeshifter Planeshifter marked this pull request as ready for review April 23, 2026 21:40
@Planeshifter Planeshifter requested review from a team and kgryte April 23, 2026 21:40
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Apr 23, 2026
@kgryte
Copy link
Copy Markdown
Member

kgryte commented Apr 23, 2026

/stdlib merge

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Apr 23, 2026
@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Apr 23, 2026
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Apr 23, 2026
@kgryte kgryte merged commit 41606e2 into develop Apr 23, 2026
16 checks passed
@kgryte kgryte deleted the philipp/drift-stats-base-dists-chi-2026-04-23 branch April 23, 2026 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants